package com.yutel.util;

import java.io.*;

/**
 * @author yuanyajun
 * 
 */
public class Account {

    private String username;
    private String password;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Account(String username, String password) {
        this.username = username;
        this.password = password;
    }

    public Account() {

    }
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void serialize(DataOutputStream dos) throws IOException {
        dos.writeUTF(username);
        dos.writeUTF(password);
    }

    public static Account deserialize(DataInputStream dis) throws IOException {
        Account account = new Account();
        account.setUsername(dis.readUTF());
        account.setPassword(dis.readUTF());
        return account;
    }
}
